package com.woparker.kiosk.config;

import android.os.Environment;

/**
 * Created by yuanxd on 2017/10/10 0010.
 * 常量对象
 */

public class Constant {
    //进入设置界面默认账号
    public static final String ACCOUNT = "admin8";
    //每页显示条数
    public static final int PAGE_SIZE = 50;
    //200*200大小
    public static final int SIZE_ONE = 1;
    //380*380大小
    public static final int SIZE_TWO = 2;

    public static final int SCREEN_AUTO = 0;
    public static final int SCREEN_HORIZONTAL = 1;
    public static final int SCREEN_VERTICAL = 2;

    //是否是8个方位寻路
    public static final boolean IS_DERECTION_EIGHT = false;
    //IMEI编号
    public static  String IMEI_STR="未知";
    //下载APK名称
    public static final String DOWNLOAD_APK_NAME = "TenetQueryMachine.apk";
    //默认城市名
    public static final String DEFOULT_CITY = "粤";
    //位置
    public static final String LOCATION = "未知";
    //查询机默认X坐标
    public static final int POINT_X = 373;
    //查询机默认Y坐标
    public static final int POINT_y = 468;
    //同步系统时间(中午同步一次)
    public static final String SYN_TIME = "05:57:00";
    //重启系统时间(凌晨2点)
    public static final String SYN_RESTART_TIME = "01:59:59";
    //日志开关
    public static final boolean LOG_SWITCH = true;
    //心跳日志开关
    public static  boolean LOG_HEART_SWITCH = false;
    //版本号
    public static String VERSION_NAME = "";

    //查询机类型(false 横屏查询机,true 竖屏查询机)
    public static boolean QUERY_IS_VERTICAL = false;
    //主文件路径
    public static final  String MAIN_PATH = Environment.getExternalStorageDirectory().getPath();
    //文件下载地址
    public static final String DOWNLOAD_FILE_PATH = Constant.MAIN_PATH + "/crash_file/";




    /**
     * 缓存常量
     */
   public static class SharedPConstant{
        public static final String  SP_SCREEN_WIDTH = "SP_SCREEN_WIDTH";
        public static final String  SP_SCREEN_HEIGHT = "SP_SCREEN_HEIGHT";
        //缓存对象
        public static final String  SP_CASH_BEAN = "SP_CASH_BEAN";
        //视频集合字符串
        public static final String VIDEO_GROUP_STR = "VIDEO_GROUP_STR";
        //图片字符串
        public static final String IMAGE_GROUP_STR = "IMAGE_GROUP_STR";
        //公告字符串
        public static final String NOTICE_GROUP_STR = "NOTICE_GROUP_STR";
        //logo图标
        public static final String IMAGE_LOGO = "IMAGE_LOGO";
        //背景
        public static final String IMAGE_BG = "IMAGE_BG";

    }


    /**
     * 系统常量
     */
   public static class SystemConstant{
        //心跳时间
        public   static int HEART_BEAT_TIME = 10*1000;
        //心跳失败最大次数(超过该次数显示连接断开)
        public final  static  int HEART_TIMES_MAX = 5;
        //触摸检测时长
        public final  static int TOUCH_BEAT_TIME = 1*1000;
        //间隔时间回到主界面(单位秒)
        public   static int AUTO_BACK_TIME = 120;
        //时间校验秒
        public  final static int VERIFY_TIME = 60;
        //现在时间
        public static long NOW_TIME = System.currentTimeMillis();
        //logo图标
        public static String LOGO_URL="";
    }



    public static class URLConstant{
        //测试地址
//        public static final String BASE_TAG = ":8080/parkingguide/api";
        //正式地址
        public static final String BASE_TAG = "/api";

        public static String getBaseUrl(){
            StringBuilder baseUrl = new StringBuilder();
            baseUrl.append("http://");
            baseUrl.append(BASE_IP);
            baseUrl.append(BASE_TAG);
            return baseUrl.toString();
        }

        public static String getBaseDownloadUrl(){
            StringBuilder baseUrl = new StringBuilder();
            baseUrl.append("http://");
            baseUrl.append(BASE_IP);
//            baseUrl.append(":8080/parkingguide");
            return baseUrl.toString();
        }


        public static String getBaseDownloadBGUrl(){
            StringBuilder baseUrl = new StringBuilder();
            baseUrl.append("http://");
            baseUrl.append(BASE_IP);
//            baseUrl.append(":8080");
            return baseUrl.toString();
        }


        public static String getGrideDownloadBGUrl(){
            StringBuilder baseUrl = new StringBuilder();
            baseUrl.append("http://");
            baseUrl.append(BASE_IP);
            baseUrl.append(":8081");
            return baseUrl.toString();
        }


        public static String getBaseCutBGUrl(){
            StringBuilder baseUrl = new StringBuilder();
            baseUrl.append("http://");
            baseUrl.append(BASE_IP);
            baseUrl.append(":8081");
            return baseUrl.toString();
        }

        //默认IP
        public static  String BASE_IP = "192.168.77.1";
        //默认子网掩码
        public static final String BASE_MASK = "255.255.0.0";
        //心跳
        public static final String HEART = "/heart";
        //APK更新
        public static final String APK_UPDATA_URL = "/update";
        //查询车辆
        public static final String QUERY_CAR_URL = "/query";
        //错误日志
        public static final String LOG_UPLOAD_RUL = "/log";
        //付款码地址
//        public static  String PAY_CODE_URL = "https://www.deliyun.cn/";   // chenjl
        public static  String PAY_CODE_URL = "";
        //地图数组数据
        public static final String MAP_GROUP_URL = "/upload/map/";
        //下载APK地址
        public static final String DOWNLOAD_APP_URL = "/updateApk";
        //获取地图数据地址
        public static final String GET_MAP_DATA_URL = "/api/queryMachine/getMapV2";
        //获取服务器时间
        public static final String GET_SERVICE_TIME = "/getTime";




    }

    /**
     * 查询常量
     */
    public static class QueryConstant{
        //默认
        public   static final int QUERY_TYPE_NORMAL = 0;

        //查询类型-车牌精确查询
        public static final int QUERY_TYPE_ACCURATE = 1;
        //查询类型-车牌模糊查询
        public static final int QUERY_TYPE_DIM= 2;

        //车位
        public   static final int QUERY_TYPE_CARPORT = 3;
        //时间
        public   static final int QUERY_TYPE_TIME = 4;

        // 车牌精确加车位查询
        public static final int QUERY_TYPE_ACCURATE_AND_CARPORT = 5;
        // 车牌模糊加车位查询
        public static final int QUERY_TYPE_DIM_AND_CARPORT = 6;
    }





    /**
     * 心跳常量
     */
    public static class HeartConstant{
        //设置IP
        public   static final int HEART_SET_IP = 2;
        //更新APK
        public static final int HEART_UPDATA_APK = 3;
    }

    /**
     * 主界面常量
     */
    public static class MainConstant{
        //更新背景图片
        public static final int UPDAA_BG = 1;
        //连接状态
        public static final int CONNECT_STATE = 2;
        //更新时间
        public static final int UPDAA_TIME = 3;
        //更新竖屏头部UI
        public static final int VERTICAL_TOP_UI = 4;
        //更新横屏头部UI
        public static final int HORIZONTAL_TOP_UI = 5;

        //更新竖屏底部UI
        public static final int VERTICAL_BOTTOM_UI = 6;
        //更新横屏头部UI
        public static final int HORIZONTAL_BOTTOM_UI = 7;

        //更新公告
        public static final int NOTICE_UI = 8;
        //打印toast
        public static final int SHOW_TOAST = 9;
        //更新logo图标
        public static final int UPDAA_LOGO = 10;

        //当前默认已连接
        public static int CONNECT_NOW_SATE = 0;
        //已连接
        public static final int CONNECT_TRUE = 0;
        //未连接
        public static final int CONNECT_FALSE = 1;
    }


}
